Halle Berry has pulled out of the running to play a transgender character in an upcoming untitled film following a social media backlash.